package com.kk.demo.meilin;

import java.util.Scanner;

import com.kk.demo.meilin.load.PeopleTaxRute;
import com.kk.demo.meilin.load.TaxRuteLoad;

public class CountMoney {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);

        System.out.println("*全部薪金所得:(Total Gross):包括基本工资，各项福利，补助，加班等工资性收入");
        float allValue = input.nextFloat();
        System.out.println("免税部分1,社保公积金个人部分,(Non-Taxable)");
        float useOne = input.nextFloat();
        System.out.println("免税部分2,个税起征点,(Non-Taxable)");
        float useTwo = input.nextFloat();

        float baseValue = allValue - useOne - useTwo;

        System.out.println("应纳税基数:" + baseValue);

        PeopleTaxRute taxRute = TaxRuteLoad.getTaxRute(allValue);

        System.out.println("税档:" + taxRute.getTaxRate());
        System.out.println("扣除:" + taxRute.getDeduct());

        float rax = baseValue * taxRute.getTaxRate() - taxRute.getDeduct();
        System.out.println("个人所得税:" + rax);
        float endValue = allValue - useOne - rax;
        System.out.println("净收入:" + endValue);

    }

}
